import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import jiaoshiList from '../pages/jiaoshi/list'
import jiaoshiDetail from '../pages/jiaoshi/detail'
import jiaoshiAdd from '../pages/jiaoshi/add'
import kechengleixingList from '../pages/kechengleixing/list'
import kechengleixingDetail from '../pages/kechengleixing/detail'
import kechengleixingAdd from '../pages/kechengleixing/add'
import jiajiaoxinxiList from '../pages/kechengxinxi/list'
import jiajiaoxinxiDetail from '../pages/kechengxinxi/detail'
import jiajiaoxinxiAdd from '../pages/kechengxinxi/add'
import jiajiaoyuyueList from '../pages/jiajiaoyuyue/list'
import jiajiaoyuyueDetail from '../pages/jiajiaoyuyue/detail'
import jiajiaoyuyueAdd from '../pages/jiajiaoyuyue/add'
import yuyuequxiaoList from '../pages/yuyuequxiao/list'
import yuyuequxiaoDetail from '../pages/yuyuequxiao/detail'
import yuyuequxiaoAdd from '../pages/yuyuequxiao/add'
import pingjiaxinxiList from '../pages/pingjiaxinxi/list'
import pingjiaxinxiDetail from '../pages/pingjiaxinxi/detail'
import pingjiaxinxiAdd from '../pages/pingjiaxinxi/add'
import jiaoshigangweiList from '../pages/jiaoshigangwei/list'
import jiaoshigangweiDetail from '../pages/jiaoshigangwei/detail'
import jiaoshigangweiAdd from '../pages/jiaoshigangwei/add'
import Messages from '../pages/messages/list'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'messages',
					component: Messages
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'news',
					component: News
				},
				{
					path: 'newsDetail',
					component: NewsDetail
				},
				{
					path: 'jiaoshi',
					component: jiaoshiList
				},
				{
					path: 'jiaoshiDetail',
					component: jiaoshiDetail
				},
				{
					path: 'jiaoshiAdd',
					component: jiaoshiAdd
				},
				{
					path: 'kechengleixing',
					component: kechengleixingList
				},
				{
					path: 'kechengleixingDetail',
					component: kechengleixingDetail
				},
				{
					path: 'kechengleixingAdd',
					component: kechengleixingAdd
				},
				{
					path: 'kechengxinxi',
					component: jiajiaoxinxiList
				},
				{
					path: 'jiajiaoxinxiDetail',
					component: jiajiaoxinxiDetail
				},
				{
					path: 'jiajiaoxinxiAdd',
					component: jiajiaoxinxiAdd
				},
				{
					path: 'jiajiaoyuyue',
					component: jiajiaoyuyueList
				},
				{
					path: 'jiajiaoyuyueDetail',
					component: jiajiaoyuyueDetail
				},
				{
					path: 'jiajiaoyuyueAdd',
					component: jiajiaoyuyueAdd
				},
				{
					path: 'yuyuequxiao',
					component: yuyuequxiaoList
				},
				{
					path: 'yuyuequxiaoDetail',
					component: yuyuequxiaoDetail
				},
				{
					path: 'yuyuequxiaoAdd',
					component: yuyuequxiaoAdd
				},
			
				{
					path: 'pingjiaxinxi',
					component: pingjiaxinxiList
				},
				{
					path: 'pingjiaxinxiDetail',
					component: pingjiaxinxiDetail
				},
				{
					path: 'pingjiaxinxiAdd',
					component: pingjiaxinxiAdd
				},
			
				
				{
					path: 'jiaoshigangwei',
					component: jiaoshigangweiList
				},
				{
					path: 'jiaoshigangweiDetail',
					component: jiaoshigangweiDetail
				},
				{
					path: 'jiaoshigangweiAdd',
					component: jiaoshigangweiAdd
				}
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
	]
})
